
package com.example.paper.common.datam.userStudentJob;

import com.example.paper.common.datam.migrate.job.BaseJob;
import com.example.paper.common.datam.migrate.processor.Processor;
import com.example.paper.common.datam.migrate.reader.Reader;
import com.example.paper.common.datam.migrate.writer.Writer;
import com.example.paper.common.entity.UserStudent;
import com.example.paper.common.entity.UserStudent2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * 描述.
 *
 * @author Long Fengfan, 2022年10月17日

 */
@Component
public class UserStudentJob extends BaseJob<UserStudent, UserStudent2> {


    @Autowired
    private UserStudentReader userStudentReader;

    @Autowired
    private UserStudentProcessor userStudentProcessor;

    @Autowired
    private UserStudentWriter userStudentWriter;


    @Override
    public void doJob(Map<String, Object> jobParams) {
        Map<String, Object> processorParams = new HashMap<>();
        getProcessor().migrate(getReader(),getWriter(), processorParams);
    }


    @Override
    public Reader<UserStudent> getReader() {
        return userStudentReader;
    }

    @Override
    public Processor<UserStudent, UserStudent2> getProcessor() {
        return userStudentProcessor;
    }

    @Override
    public Writer<UserStudent2> getWriter() {
        return userStudentWriter;
    }

}
